<?php

namespace SinoPHP\BbdBoss\Model;

use Upfor\UpforPHP\Model;

/**
 * 管理员操作日志
 */
class AdminOperateLog extends Model {

    public function getLogList(array $where, $pageNumber = 1, $pageSize = 20, $orderBy = null) {
        $this->db->table($this->getTableName())->field([
            'log_id',
            'admin_user_id',
            'username',
            'action',
            'brief',
            'ip',
            'create_time',
        ]);

        $this->db->where($where);

        $this->db->page($pageNumber, $pageSize);

        if ($orderBy) {
            $this->db->order($orderBy);
        }

        return $this->db->getList();
    }

}
